/**
 * 描述：表单数据源页面布局
 * 作者：zhaohaibo
 * 日期：3/22/2019
 * 版本：0.0.1
 **/

(function(E, KIT, RES) {
  var __WRAP_CLS = "r-full-h r-corner-all r-bd " + KIT.BD_COLOR,
    __LIST_CLS = "r-bd-t " + KIT.BD_COLOR;

  var _buildTitle = function(title) {
      return E.view({cssClass: "r-p-l r-p-tb-sm r-bold r-bd-b r-bg-0-3 " + KIT.BD_COLOR}, title);
    },
    _buildToolbar = function(suffix, tip) {
      return E.flex({cssClass: "r-p-m-sm"},
        E.textbox({
          id: "txtName" + suffix, submitIcon: "fa-plus", disabled: true,
          tip: tip, color: 1, style: "transparent", cssClass: "r-flex-item"
        }),
        E.button({
          id: "btnCancel" + suffix, icon: "fa-ban", cssClass: "r-corner-tr",
          corner: false, visible: false
        })
      );
    };

  rapid.Page.create("FormDataSource", {
    render: {
      titleBar: "表单数据源维护",
      main: E.view({cssClass: "r-full-h r-row r-p"},
        E.view({cssClass: __WRAP_CLS + " r-col-4"},
          E.flexv({cssClass: "r-full-h r-bg-0"},
            _buildTitle("数据源"),
            _buildToolbar("Par", "在这里输入要添加的 数据源名称..."),
            E.flexitem({id: "lstPar", cssClass: __LIST_CLS})
          )
        ),
        E.view({cssClass: __WRAP_CLS + " r-col-8"},
          E.flexv({cssClass: "r-full-h r-bg-0"},
            _buildTitle("数据项"),
            _buildToolbar("Sub", "在这里输入要添加的 数据项名称..."),
            E.flexitem({id: "lstSub", cssClass: __LIST_CLS})
          )
        )
      )
    }
  });

})(rapid.html.Element, rapid.kit, rapid.res);
 